Skip to content

docs(inversion): two-stage curvature kernel docstring — dispatch is on pix_pixels; two-stage wins on Delaunay too (autolens_profiling#274) - #557

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/fixed-light-numba-s4
Sep 17, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/fixed-light-numba-s4

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Docstring-only fix from autolens_profiling#274 (fixed-lens-light numba CPU, phase 4 wave A). The two-stage curvature kernel's docstring said the dispatcher curvature_matrix_via_sparse_operator_from "chooses between the two from the measured geometry -- see CURVATURE_TWO_STAGE_COST_RATIO_THRESHOLD". No such constant exists; the dispatcher branches on pix_pixels <= CURVATURE_TWO_STAGE_MAX_PIX_PIXELS (4096). The same paragraph predicted that two-stage "loses when the source space is large and the mappings narrow (barycentric Delaunay, u0 ~ 1.55)". That prediction was never measured on the Delaunay fixed-light cell; lever 4a measured it (RAL job 343394, HST Delaunay N=1500, u0 = 1.604, one thread, 64 repeats, ABBA gate PASS on every row) and it is refuted there: two-stage beats the direct loop 85.0 vs 102.1 ms at the site and by 6.4 % on the whole likelihood call, and a touched-index two-stage variant is slower too (97.0 ms). The docstring now names the real dispatch rule and records the measurement in place of the refuted prediction. No code change; the pixel-count cap stands.

API Changes

None — internal changes only (one docstring).

Test Plan

  • pytest test_autoarray/inversion/inversion/imaging/test_inversion_imaging_util.py -q (docstring-only change; the two-stage reference / dense-operator / dispatch tests at :829 / :887 / :947 unchanged)
  • grep -rn CURVATURE_TWO_STAGE_COST_RATIO_THRESHOLD autoarray/ returns nothing
  • Library CI green
Full API Changes (for automation & release notes)

Changed Behaviour

  • none — docstring of autoarray.inversion.inversion.imaging_numba.inversion_imaging_numba_util.curvature_matrix_via_sparse_operator_two_stage_from corrected (dispatch rule + the lever 4a measurement).

Measured in autolens_profiling#274 (note results/notes/fixed_lens_light_s4_2026_09.md, profiling PR linked from the issue).

🤖 Generated with Claude Code

…ispatch is on pix_pixels, and two-stage wins on Delaunay too (autolens_profiling#274)

The docstring named a CURVATURE_TWO_STAGE_COST_RATIO_THRESHOLD that does not exist (the dispatcher branches on pix_pixels <= CURVATURE_TWO_STAGE_MAX_PIX_PIXELS) and predicted the two-stage form loses for narrow barycentric Delaunay mappings. Lever 4a measured that prediction on the HST Delaunay N=1500 fixed-light cell (RAL job 343394, u0 = 1.604, one thread, 64 repeats, ABBA PASS): two-stage beats the direct loop 85.0 vs 102.1 ms at the site and by 6.4 % on the whole call, and a touched-index variant is slower too. No code change.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Sep 17, 2026
@Jammy2211

Copy link
Copy Markdown
Collaborator Author

Measured in autolens_profiling#274 / PR PyAutoLabs/autolens_profiling#275 (note results/notes/fixed_lens_light_s4_2026_09.md).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant